{template "header.html"}


<div class="right-card-box">
<form class="form-horizontal" role="form" id="myform">
    {dr_form_hidden()}
    <div class="bootstrap-table bootstrap-table2">
        <div id="toolbar" class="toolbar">
        <label><button type="button" onclick="dr_ajax_option('{dr_url('field/del', ['rname' => $rname, 'rid' => $rid])}', '{dr_lang('你确定要删除它们吗？')}', 1)" class="btn red btn-sm"> <i class="fa fa-trash"></i> {dr_lang('删除')}</button></label>
            <label><button type="button" onclick="javascript:dr_dcall();" class="btn blue btn-sm"> <i class="fa fa-sign-out"></i> {dr_lang('导出')}</button></label>
        </div>
    </div>


    <div class="clearfix"></div>
    <div class="table-scrollable table-clearfix">


        <table class="table table-noborder table-fc-upload table-striped table-bordered table-hover table-checkable dataTable">
            <thead>
            <tr class="heading">
            {if $ci->_is_admin_auth('del')}
            <th class="myselect">
                <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                    <input type="checkbox" class="group-checkable" data-set=".checkboxes" />
                    <span></span>
                </label>
            </th>
            {/if}
            <th width="65" style="text-align:center"> {dr_lang('排序')} </th>
            <th style="text-align: center;font-size: 15px;" width="65">Id</th>
            <th>{dr_lang('字段')}</th>
            <th width="120">{dr_lang('类别')}</th>
            <th width="70" style="text-align: center">{dr_lang('系统')}</th>
            <th width="70" style="text-align: center">{dr_lang('主表')}</th>
            <th width="80"  style="text-align: center">{dr_lang('XSS过滤')}</th>
            <th width="70" style="text-align: center">{dr_lang('前端')}</th>
            <th width="70" style="text-align: center">{dr_lang('可用')}</th>
            <th width="150"></th>
        </tr>
        </thead>
        <tbody>
        {loop $list $t}
        <tr class="odd gradeX" id="dr_row_{$t.id}">
            {if $ci->_is_admin_auth('del')}
            <td class="myselect">
                <label class="mt-table mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                    {if $t.issystem}
                    <input type="checkbox" class="" disabled name="" value="" />
                    {else}
                    <input type="checkbox" class="checkboxes" name="ids[]" value="{$t.id}" />
                    {/if}
                    <span></span>
                </label>
            </td>
            {/if}
            <td style="text-align:center"> {if $t.spacer}{else}<input type="text" onblur="dr_ajax_save(this.value, '{dr_url('field/option', ['rname' => $rname, 'rid' => $rid, 'op' => 'save', 'id'=>$t.id])}', 'displayorder')" value="{$t.displayorder}" class="displayorder form-control input-sm input-inline input-mini"> {/if}</td>
            <td style="text-align: center;font-size: 15px;">{$t.id}</td>
            <td> {$t.spacer}  {dr_lang($t.name)} / {$t.fieldname}</td>
            <td>{$t.ftype}</td>
            <td style="text-align: center;font-size: 15px;">{if $t.issystem}<i class="fa fa-check-circle"></i>{else}-{/if}</td>
            <td style="text-align: center;font-size: 15px;">{if $t.ismain}<i class="fa fa-check-circle"></i>{else}<i class="fa fa-times-circle"></i>{/if}</td>
            <td style="text-align:center">
                <a href="javascript:;" onclick="dr_ajax_open_close(this, '{dr_url('field/option', ['rname' => $rname, 'rid' => $rid, 'op' => 'xss', 'id'=>$t.id])}', 0);" class="badge badge-{if $t['setting']['validate']['xss']}yes{else}no{/if}"><i class="fa fa-{if $t['setting']['validate']['xss']}check{else}times{/if}"></i></a>
            </td>
            <td style="text-align:center">
                <a href="javascript:;" onclick="dr_ajax_open_close(this, '{dr_url('field/option', ['rname' => $rname, 'rid' => $rid, 'op' => 'member','id'=>$t.id])}', 0);" class="badge badge-{if !$t.ismember}no{else}yes{/if}"><i class="fa fa-{if !$t.ismember}times{else}check{/if}"></i></a>
            </td>
            <td style="text-align:center">
                <a href="javascript:;" onclick="dr_ajax_open_close(this, '{dr_url('field/option', ['rname' => $rname, 'rid' => $rid, 'op' => 'disabled','id'=>$t.id])}', 1);" class="badge badge-{if $t.disabled}no{else}yes{/if}"><i class="fa fa-{if $t.disabled}times{else}check{/if}"></i></a>
            </td>
            <td>
                <label><a href="{dr_url('field/edit', ['rname' => $rname, 'rid' => $rid, 'id'=>$t.id])}" class="btn btn-xs green"> <i class="fa fa-edit"></i> {dr_lang('修改')} </a></label>
                <label><a href="javascript:dr_iframe_show('{dr_lang('导出')}', '{dr_url('field/export', ['rname' => $rname, 'rid' => $rid, 'id'=>$t.id])}');" class="btn btn-xs red"> <i class="fa fa-sign-out"></i> {dr_lang('导出')} </a></label>
            </td>
        </tr>
        {/loop}
        </tbody>
    </table>
    </div>


</form>
</div>
<script>
    function dr_dcall() {
        dr_iframe_show('{dr_lang('导出')}', '{dr_url('field/export_all', ['rname' => $rname, 'rid' => $rid, 'id'=>$t.id])}&ids='+$('#myform').serialize());
    }
</script>
{template "footer.html"}